<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Reset Password</title>

    <link href="/static/jquery-weui/css/jquery-weui.css" rel="stylesheet">
    <link href="/static/jquery-weui/lib/weui.css" rel="stylesheet">

    <script src="/static/jquery-weui/lib/jquery-2.1.4.js"></script>
    <script src="/static/jquery/jquery.json.min.js"></script>
    <script src="/static/jquery-weui/js/jquery-weui.js"></script>
    <script src="/static/js/md5.min.js"></script>

</head>

<body>

<h1 style="text-align: center;">Chain For Perls</h1>

<div class="weui_cells weui_cells_form" style="width:455px;margin: 10px auto 10px auto;">

    <div class="weui_cell">
        <div class="weui_cell_hd"><label class="weui_label">用户名</label></div>
        <div class="weui_cell_bd weui_cell_primary">
            <input id="username_input" class="weui_input" type="text">
        </div>
    </div>


    <div class="weui_cell">
        <div class="weui_cell_hd"><label class="weui_label">原密码</label></div>
        <div class="weui_cell_bd weui_cell_primary">
            <input id="password_input" class="weui_input" type="password">
        </div>
    </div>

    <div class="weui_cell">
        <div class="weui_cell_hd"><label class="weui_label">新密码</label></div>
        <div class="weui_cell_bd weui_cell_primary">
            <input id="new_password_input" class="weui_input" type="password">
        </div>
    </div>

    <div class="weui_cell">
        <div class="weui_cell_hd"><label class="weui_label">确认密码</label></div>
        <div class="weui_cell_bd weui_cell_primary">
            <input id="validate_password_input" class="weui_input" type="password">
        </div>
    </div>

</div>

<div id="buttons" class="buttons">

    <div class='demos-content-padded' style="width:455px;margin: 10px auto 10px auto;">
        <button id="register_btn" class="weui_btn weui_btn_primary" >更改</button>
    </div>

</div>

<script src="/static/js/game.js"></script>
<script src="/static/js/driver.js"></script>


<script>

    $('#register_btn').click(function() {
        var username = $('#username_input')[0].value;
        var password = $('#password_input')[0].value;
        var new_password = $('#new_password_input')[0].value;
        var validate_password = $('#validate_password_input')[0].value;
        if ( validate_password != new_password) {
            $.alert("两次输入的密码不一致");
            return null;
        }
        resetPassword(username, password, new_password);
    });

</script>

</body>
</html>